<!DOCTYPE html>
<html xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:vti="http://java.sun.com/jsf/composite/components/vti">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <ui:insert name="metadata" />
        <title>
            <ui:insert name="titulo">
                <h:outputText value="#{msgs['titulo.aplicacao']}" />
            </ui:insert>
        </title>
        <link href="#{request.contextPath}/resources/css/estilos.css" rel="stylesheet" type="text/css"/>
        <link rel="icon" href="#{request.contextPath}/resources/images/favicon-vti.ico" type="image/x-icon"/>
        <script type="text/javascript" src="#{request.contextPath}/resources/js/util.js"></script>
        <script type="text/javascript">
            history.forward(1);  //barrar o botão voltar

            $ = jQuery.noConflict();

            $(function() {
                var tam = $(window).height();
                var conteudo = $("#conteudo");
                conteudo.css("height", tam-185);
                $(".input:visible:enabled:first").focus();
                
                var botao = $("#userButton");
                botao.bind("click", function() {
                    document.location.href = "#{request.contextPath}/pages/usuario.jsf";
                });
            });

            $(window).resize(function() { 
                var tam = $(window).height();
                $("#conteudo").css("height", tam-185);
            });
        </script>
    </h:head>
    <h:body>
        <div id="tudo" >
            <div id="topo">
                <div id="topoEsquerdo">
                </div>
                <div id="topoDireito">
                    <img src="../resources/images/img-titulo.png" />
                </div>
                <div style="clear: both;"></div>
            </div>
            <div id="toolbar" class="ui-toolbar">
                <ui:include src="/pages/templates/menu.xhtml" />
            </div>
            <div id="barraEsquerda">
                <div id="conteudo">
                    <p:messages id="messages" globalOnly="true" showDetail="true" showSummary="false" />
                    <ui:insert name="conteudo" />
                </div>
            </div>
            <div id="rodape">
                <ui:insert name="rodape">
                    <div id="rodapeEsquerdo">
                        <p><h:outputLabel value="#{msgs['rodape.versao']}" /></p>
                    </div>
                    <div id="rodapeDireito">
                        <p><h:outputLabel value="#{msgs['rodape.texto']}" /></p>
                    </div>
                </ui:insert>
            </div>
        </div>
        <vti:modalProgress id="modalProgress" />
    </h:body>
</html>